package com.sh.data.engine.application.model.request.datadev;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @author: zigui.zdf
 * @description:
 * @date: 2021/7/22 15:06
 */
@Data
@Schema
public class RestartJobRequest {

    @Schema(description = "记录id", required = true)
    @NotNull(message = "记录id不能为空")
    private Long id;

    @Schema(
        description = "重跑类型，0-丢弃停止前的状态 1-使用上次任务参数重跑 2-指定offset",
        requiredMode = Schema.RequiredMode.REQUIRED,
        allowableValues = {"0", "1", "2"})
    @NotNull(message = "重跑类型不能为空")
    private Integer type;

    @Schema(description = "offset，type为2时传入")
    private List<TableTime> tableTimes;

    @Data
    @Schema
    public static class TableTime {
        @Schema(description = "表名")
        private String table;

        @Schema(description = "时间戳,yyyy-MM-dd HH:mm:ss")
        private String time;
    }
}
